package com.yangxk.kadmin.generator.rules;

import com.fasterxml.jackson.annotation.JsonValue;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据库查询匹配模式
 * @author yangxk
 * @date 2018/10/4 20:05
 */
public enum Match {
    eq("="),
    neq("!="),
    gt(">"),
    lt("<"),
    egt(">="),
    elt("<="),
    like("like"),
    between("between");

    private String symbol; // 符号

    Match(String symbol) {
        this.symbol = symbol;
    }

    @JsonValue
    public String getSymbol() {
        return symbol;
    }

    public static List<String> lists() {
        List<String> result = new ArrayList<>();
        for (Match match : Match.values()) {
            result.add(match.symbol);
        }
        return result;
    }

}
